home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16944 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  44 lines

  1. Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
  2. Path: mercury.hsi.com!news
  3. From: marksc@wpmail.code3.com (Mark A. Scarton)
  4. Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
  5. Message-ID: <316e7e85.177818679@mercury.hsi.com>
  6. Sender: news@hsi.com (USENET news)
  7. Nntp-Posting-Host: pc027064.code3.com
  8. Reply-To: marksc@wpmail.code3.com
  9. Organization: 3M Health Information Systems
  10. X-Newsreader: Forte Agent .99d/32.182
  11. References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk> <4jes0t$gth@decaxp.HARVARD.EDU> <31630E30.5A02@oma.com> <4kbq3q$1i8@gaia.ns.utk.edu> <RMARTIN.96Apr9160010@rcm.oma.com>
  12. Date: Fri, 12 Apr 1996 16:08:20 GMT
  13.  
  14. >   : Malloc and new can *always* be made to be deterministic.  That is
  15. >   : one of the major attractions to manual memory management in 
  16. >   : real time systems.  You can use malloc/free (new/delete) pairs which are
  17. >   : 100% predictable.
  18. >
  19. >   Are they?  Have you gone through the all the possible orderings of
  20. >   previous 'new' and 'malloc' so that you ***KNOW*** exactly
  21. >   what the internal heap structures are so that subsequent calls to 
  22. >   'malloc' and 'new' and 'free' take a known amount of time?
  23. >
  24. >Yes.  Simply because it is possible to create memory allocators that
  25. >don't use heaps.  Rather they use completely deterministic lists of
  26. >preallocated blocks.  The time for 'new' and the time for 'delete' are
  27. >absolutely constant.  The exact same number of instructions execute no
  28. >matter what order new and delete are called in.
  29.  
  30. I must concur.  I built a passive sensor system (radar) using OS/2 for
  31. management, flow control, and display preparation and an adapter with i860 chips
  32. for the object tracker.  I used (feed forward) queues of preallocated memory
  33. blocks to hold incoming signals within frames, where the queue management was
  34. preallocated slots for pointers into the block buffers.  The queue memory was
  35. then shared among the processors...successfully even.  ;-)  This resulted in a
  36. determinstic, highly optimized memory manager.  Plus real-time tracking of
  37. aircraft and short range ballistic missiles on a 486/50 class PC.  The previous
  38. edition using malloc had failed.
  39.  
  40. Mark A. Scarton, ABD
  41. CompUtah!, Park City, Utah USA
  42. Home: 801.565.9835
  43. Office: 801.265-4612
  44.